package com.moxiao.yfjh.module.blind.dal.mysql.memberusertag;

import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import com.moxiao.yfjh.module.blind.dal.dataobject.memberusertag.MemberUsertagDO;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.blind.controller.admin.memberusertag.vo.*;

/**
 * 相亲用户标签 Mapper
 *
 * @author mx
 */
@Mapper
public interface MemberUsertagMapper extends BaseMapperX<MemberUsertagDO> {

    default PageResult<MemberUsertagDO> selectPage(MemberUsertagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MemberUsertagDO>()
                .eqIfPresent(MemberUsertagDO::getUserId, reqVO.getUserId())
                .eqIfPresent(MemberUsertagDO::getLabelId, reqVO.getLabelId())
                .eqIfPresent(MemberUsertagDO::getLabel, reqVO.getLabel())
                .eqIfPresent(MemberUsertagDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MemberUsertagDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberUsertagDO::getId));
    }

    default List<MemberUsertagDO> selectList(MemberUsertagExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<MemberUsertagDO>()
                .eqIfPresent(MemberUsertagDO::getUserId, reqVO.getUserId())
                .eqIfPresent(MemberUsertagDO::getLabelId, reqVO.getLabelId())
                .eqIfPresent(MemberUsertagDO::getLabel, reqVO.getLabel())
                .eqIfPresent(MemberUsertagDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MemberUsertagDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberUsertagDO::getId));
    }

}
